<?php
/** ***********************
 * 作者：gzy
 * 日期：2018/4/25
 * 作用：数据模型
 ** ***********************/
class questionModelHome extends coreFrameworkModel {
	//插入日志
	function insertApiLog($data){
		$sql = SqlToolsClass::InsertData('api_log',$data);
		return $this->Execute($sql);
	}
	//插入问题
	function add_question($data){
		$sql = SqlToolsClass::InsertData('question',$data);
		return $this->Execute($sql);
	}
	//问题类别
	function selectQeustionCategory()
	{
		$sql=SqlToolsClass::SelectItem("question_category",'','id,name');
		return $this->GetAll($sql);
	}
	//用户登录信息
	function getPersondetail($username,$password)
	{
		//$password=md5(md5($password));
		$sql=SqlToolsClass::SelectItem("shopperson","name='$username' and password='$password'",'*');
		return $this->GetAll($sql);
	}
	//获取城市id
	function getFatherId($shop_id)
	{
		$sql=SqlToolsClass::SelectItem("admin_group","id=$shop_id",'fatherclass');
		return $this->GetAll($sql);
	}
	//获取问题列表
	function getquestionByUserId($uid)
	{
		$sql=SqlToolsClass::SelectItem("question","user_id=$uid order by id desc",'*');
		return $this->GetAll($sql);
	}
	//获取问题详情
	function getquestiondetail($id)
	{
		$sql=SqlToolsClass::SelectItem("question","id=$id",'*');
		return $this->GetAll($sql);
	}
}
?>